package com.stock.mapper;

import com.stock.pojo.domain.InnerMarketDomain;
import com.stock.pojo.domain.StockUpdownDomain;
import com.stock.pojo.entity.StockMarketIndexInfo;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author AA173
 * @description 针对表【stock_market_index_info(国内大盘数据详情表)】的数据库操作Mapper
 * @createDate 2024-10-24 08:49:11
 * @Entity com.stock.pojo.entity.StockMarketIndexInfo
 */
public interface StockMarketIndexInfoMapper {

    int deleteByPrimaryKey(Long id);

    int insert(StockMarketIndexInfo record);

    int insertSelective(StockMarketIndexInfo record);

    StockMarketIndexInfo selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(StockMarketIndexInfo record);

    int updateByPrimaryKey(StockMarketIndexInfo record);

    //查询A股大盘实时数据
    List<InnerMarketDomain> getInnerMarketAll(@Param("inners") List<String> inners, @Param("lastDate") Date lastDate);

    //分页查询股票最新数据，并按照涨幅排序查询
    List<StockUpdownDomain> getStockPageInfo(@Param("lastDate") Date lastDate);

    //统计沪深两市个股最新交易数据，并按涨幅降序排序查询前4条数据
    List<StockUpdownDomain> getStockIncrease(@Param("lastDate") Date lastDate);

    //统计国内A股大盘T日和T-1日成交量对比功能（成交量为沪市和深市成交量之和）
    List<Map> getStockTradeVol(@Param("openDate") Date openDate, @Param("endDate") Date endDate, @Param("inners") List<String> inners);

    //批量插入大盘数据
    int insertBatch(@Param("infos") ArrayList<StockMarketIndexInfo> infos);
}
